﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AreaList.aspx.cs" Inherits="OpSystem.manage.city.AreaList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <!-- #include file="~/include/header.html" -->
    <style type="text/css">
        .form-control{
            display:inline-block;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <section class="content-header">
            <h1>区县管理
        <small></small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>主页</a></li>
                <li class="active">区县管理</li>
            </ol>
        </section>
        <section class="content">
            <div class="row">
                <div class="col-md-12">
                    <div class="box box-primary">
                        <div class="box-header">
                            <ul class="list-inline">
                                <li><i class="fa fa-search"></i></li>
                                <li>
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        <ContentTemplate>
                                            <asp:DropDownList ID="ddlProvince" runat="server" Width="150px" CssClass="form-control" AutoPostBack="true" OnSelectedIndexChanged="ddlLocation_SelectedIndexChanged"></asp:DropDownList>
                                            <asp:DropDownList ID="ddlCity" runat="server" Width="150px" CssClass="form-control">
                                                <asp:ListItem Value="-1">请选择市</asp:ListItem>
                                            </asp:DropDownList>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>

                                </li>
                                <li>
                                    <asp:Button ID="BtnSearch" runat="server" Text="查找" CssClass="btnadd btn btn-success btn-sm" OnClick="Button1_Click" />
                                </li>
                                <li>
                                    <button class="btnadd btn btn-success btn-sm" id="btnAdd" type="button">添加区县</button></li>
                            </ul>

                        </div>

                        <!-- /.box-header -->
                        <div class="box-body table-responsive no-padding">
                            <table class="table table-hover body-table-head">
                                <colgroup>
                                    <col style="width: 50px" />
                                    <col style="width: 120px" />
                                    <col style="width: 120px" />
                                    <col style="width: 120px" />
                                    <col style="width: 80px" />
                                </colgroup>
                                <tbody id="tbodylist">
                                    <tr>
                                        <th>
                                            <span>ID</span>
                                        </th>
                                        <th>
                                            <span>名称</span>
                                        </th>
                                        <th>
                                            <span>简称</span>
                                        </th>
                                        <th>
                                            <span>拼音</span>
                                        </th>
                                        <th class="t_c">
                                            <span>操作</span>
                                        </th>
                                    </tr>

                                    <asp:Repeater runat="server" ID="rptList">
                                        <ItemTemplate>
                                            <tr>
                                                <td class="title">
                                                    <%#Eval("LocationId")%>
                                                </td>
                                                <td class="title">
                                                    <%#Eval("LocationName")%>
                                                </td>
                                                <td>
                                                    <%#Eval("LocationShortName")%>
                                                </td>
                                                <td class="title">
                                                    <%#Eval("LocationSpellName")%>
                                                </td>

                                                <td class="t_c">
                                                    <button type="button" class="btn btn-info btn-xs" onclick="edit('','<%# Eval("LocationId")%>')">编辑</button>
                                                    <button type="button" class="btn btn-danger btn-xs" onclick="del('<%# Eval("LocationId")%>')">删除</button>
                                                </td>

                                            </tr>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <tr style='display: <%#bool.Parse((rptList.Items.Count==0).ToString())==true?"":"none"%>'>
                                                <td colspan="5" style="text-align: center">
                                                    <div class="no-data">
                                                        <div class="img-box"></div>
                                                        <div class="text">暂无数据</div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </FooterTemplate>
                                    </asp:Repeater>

                                </tbody>
                            </table>
                        </div>
                        <div class="box-footer clearfix ">
                            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" showinputbox="Never" CssClass="pagination pagination-sm no-margin pull-right"
                                PageSize="10" OnPageChanged="AspNetPager1_PageChanged" LayoutType="Ul"
                                PagingButtonLayoutType="UnorderedList" PagingButtonSpacing="0" CurrentPageButtonClass="active">
                            </webdiyer:AspNetPager>

                        </div>

                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>

            </div>
        </section>
    </form>
    <!-- #include file="~/include/footer.html" -->
    <script type="text/javascript">
        $("#btnAdd").click(function () {
            edit('添加区县');
        });

        function edit(title, id) {
            var tl = '修改区县';
            if (title != '') {
                tl = title;
            }
            var url = '<%=GetPageUrl("AddArea.aspx")%>'
            if (id != null) {
                url += "?id=" + id;
            }
            BMCW.showTopLayer(tl, url, 630, 463);
        }

        function del(id) {
            BMCW.DataConfirmMaskDel('delarea', id);
        }

    </script>
</body>
</html>
